package com.atguigu.day11.exer.area;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/12 10:35
 * @注释
 */
public class Circle extends Graphic {
    private int radius;

    @Override
    public double area() {
        return Math.PI * radius * radius;
    }

    @Override
    public double perimeter() {
        return 2 * Math.PI * radius;
    }

    @Override
    public String getInfo() {
        return "半径：" + radius + super.getInfo();
    }

    public Circle() {
    }

    public Circle(int radius) {
        this.radius = radius;
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
    }


}
